import {request} from './request.js'

// 验证邮箱或用户名是否存在
function testExist({key, value}) {
  return request({
    url: '/testexist',
    params: {key, value}
  })
}

// 注册
function register(email, username, password, captcha,idKeyC) {
  return request({
    url: '/register',
    method: 'post',
    data: {
      email,
      username,
      password,idKeyC,
      captcha: captcha.toLowerCase()
    }
  })
}
// 注册
function email(email, captcha,idKeyC) {
  return request({
    url: '/email',
    method: 'post',
    data: {
      email,idKeyC,
      captcha: captcha.toLowerCase()
    }
  })
}
// 注册
function resetPwd(captcha,newpwd,email) {
  return request({
    url: '/resetPwd',
    method: 'post',
    data: {
      captcha:captcha,
      newpwd: newpwd,
      email:email
    }
  })
}
export default {
  register,
  resetPwd,
  email,
  testExist
}